package worker

var (
	ListWorker = make([]IWorker, 0)// 服务列表
)

// IWorker
// @Description: 主线程内的服务
type IWorker interface {
	Start(fnRegister func())
}

// AddWorker 添加
// @param w
// @param fnRegister
func AddWorker(w IWorker, fnRegister func()) {
	go w.Start(fnRegister)
	ListWorker = append(ListWorker, w)
}
